import http from '@/utils/request.js'

export const getProducts = (params)=> http.get('/v1/products',{params});
// export const getProducts = ()=> http.get('/v1/products');


/* export function getProductsDeatail(id) {
    return http.get(`/v1/products/${id}`);
} */

export const getProductsDeatail = async(id)=>{
    let res = await http.get(`/v1/products/${id}`).then(res=>res.data.data);
    return res;
};

export const getCategory = async() => {
    let res = await http.get('/v1/category').then(res=>res.data.data);
    return res;
};
